package com.trkj.controller.lzs;

import java.math.BigDecimal;
import java.sql.Timestamp;
import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;


import com.trkj.pojo.Recruitapply;

import com.trkj.service.lzs.RecruitapplyService;
import com.trkj.vo.Result2;
//��Ƹ���뵥
@Controller
public class RecruitapplyConrroller {
	//插叙
	@Autowired  
	private RecruitapplyService recruitapplyservice;
	@RequestMapping("lzs_findAllRecruitapply")
	@ResponseBody
	public List< Recruitapply> findAllRecruitapply(){
		List< Recruitapply> list = recruitapplyservice. recruitapplyfindAll();
		return list;
	}
	//���
	@RequestMapping("lzs_Recruitapplytianjia")
	@ResponseBody
	public void tianjia(Timestamp reappDemanddate ,String reappExplain,BigDecimal reappPlan ){
		recruitapplyservice.tj(reappDemanddate, reappExplain, reappPlan);

		
	}
	/*修改
	*/
	@RequestMapping("lzs_Recruitapplxiugai")
	@ResponseBody  
	public  Result2  payrollxiugaixiugai( long reappId, Timestamp reappDemanddate ,String reappExplain,BigDecimal reappPlan) {
		try {
			recruitapplyservice.lzs_Edit(reappId, reappDemanddate, reappExplain, reappPlan);
			return Result2.SUCCESS;
		} catch (Exception e) {
				e.printStackTrace();
			return Result2.failure(e.getMessage());
		}
		
	}
	@RequestMapping("lzs_Recruitapptj")
	@ResponseBody  
	 public Recruitapply chunq(Long reappId) {
    	 return recruitapplyservice.chun1(reappId);
     }
	
	//
	@RequestMapping("Recruitapplychaxun")
	@ResponseBody
	public  List<Recruitapply> Query(String text){
		return (List<Recruitapply>) recruitapplyservice.queryByName(text);
	}
}
